]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
loginDialog: ask for username up front if disable-user-list==TRUE
authorRay Strode <rstrode@redhat.com>
Thu, 22 Aug 2013 20:18:20 +0000 (16:18 -0400)
committerRay Strode <rstrode@redhat.com>
Fri, 23 Aug 2013 15:40:35 +0000 (11:40 -0400)
Right now, we rely on PAM to ask for the username if disable-user-list
is TRUE.  This is suboptimal because it means we can't check if we
should show a session menu.

This commit changes disable-user-list==TRUE to ask for a username up
front, rather than have PAM do it.

https://bugzilla.gnome.org/show_bug.cgi?id=706607

js/gdm/loginDialog.js

index d4ff019affc4300c25f2924c1a7623c1f0826234..c6c4f02d3c6f037a0d41b7a1e498e45c9f0e586d 100644 (file)
@@ -591,11 +591,14 @@ const LoginDialog = new Lang.Class({
 
         this._user = null;
 
-        if (!this._disableUserList &&
-            beginRequest == AuthPrompt.BeginRequestType.PROVIDE_USERNAME)
-            this._showUserList();
-        else
+        if (beginRequest == AuthPrompt.BeginRequestType.PROVIDE_USERNAME) {
+            if (!this._disableUserList)
+                this._showUserList();
+            else
+                this._hideUserListAskForUsernameAndBeginVerification();
+        } else {
             this._hideUserListAndBeginVerification();
+        }
     },
 
     _onDefaultSessionChanged: function(client, sessionId) {
@@ -606,7 +609,7 @@ const LoginDialog = new Lang.Class({
         if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.VERIFYING)
           return false;
 
-        if (this._user && this._user.is_logged_in())
+        if (this._user && this._user.is_loaded && this._user.is_logged_in())
           return false;
 
         return true;
@@ -650,6 +653,7 @@ const LoginDialog = new Lang.Class({
                                                         this._authPrompt.disconnect(nextSignalId);
                                                         this._authPrompt.updateSensitivity(false);
                                                         let answer = this._authPrompt.getAnswer();
+                                                        this._user = this._userManager.get_user(answer);
                                                         this._authPrompt.clear();
                                                         this._authPrompt.startSpinning();
                                                         this._authPrompt.begin({ userName: answer });